home *** CD-ROM | disk | FTP | other *** search
/ Champak 52 / Volume 52 - JOGO DISK .iso / Games / retroland.swf / scripts / frame_11 / DoAction.as < prev   
Text File  |  2007-10-01  |  2KB  |  75 lines

  1. function move_wait(enterFrame)
  2. {
  3.    if(Key.isDown(Kleft))
  4.    {
  5.       this.hero._xscale = -100;
  6.       this.hero.gotoAndStop("walk");
  7.    }
  8.    if(Key.isDown(Kright))
  9.    {
  10.       this.hero._xscale = 100;
  11.       this.hero.gotoAndStop("walk");
  12.    }
  13. }
  14. function jump_wait()
  15. {
  16.    if(Key.isDown(Kjump))
  17.    {
  18.       this.hero.gotoAndStop("jumpUp");
  19.    }
  20. }
  21. function fall_wait()
  22. {
  23.    if(!_root.stage.plate.hitTest(this.hero._x,this.hero._y,true))
  24.    {
  25.       this.hero.gotoAndStop("jumpDown");
  26.    }
  27. }
  28. function move_left(valueX)
  29. {
  30.    if(!_root.stage.plate.hitTest(this.hero._x - valueX - 8,this.hero._y - 4,true) && _level0.keys !== 1)
  31.    {
  32.       _root.stage._x += valueX;
  33.       _root.back._x += valueX / 4;
  34.    }
  35. }
  36. function move_right(valueX)
  37. {
  38.    if(!_root.stage.plate.hitTest(this.hero._x + valueX + 8,this.hero._y - 4,true) && _level0.keys !== 1)
  39.    {
  40.       _root.stage._x -= valueX;
  41.       _root.back._x -= valueX / 4;
  42.    }
  43. }
  44. _quality = "low";
  45. getUrl("FSCommand:fullscreen", "false");
  46. getUrl("FSCommand:allowscale", "false");
  47. Kleft = 37;
  48. Kright = 39;
  49. Kjump = 32;
  50. walkSpeed = 1.6;
  51. jumpHeight = 7.8;
  52. jumpSpeed = 0.37;
  53. fallSpeed = 2.5;
  54. function jump_down(valueY)
  55. {
  56.    if(!_root.stage.plate.hitTest(this.hero._x + 0,this.hero._y - 2,true))
  57.    {
  58.       this.hero._y += valueY;
  59.    }
  60.    else
  61.    {
  62.       i = 1;
  63.       while(i <= 20)
  64.       {
  65.          if(!_root.stage.plate.hitTest(this.hero._x,this.hero._y - i,true))
  66.          {
  67.             this.hero._y -= i - 1;
  68.             break;
  69.          }
  70.          i++;
  71.       }
  72.       this.hero.gotoAndStop("stand");
  73.    }
  74. }[_level0] = 0();
  75.